package cn.iocoder.yudao.module.brokerage.record.pojo.vo;

import cn.iocoder.yudao.framework.business.basic.pojo.vo.MemberScopeVO;
import cn.iocoder.yudao.framework.business.basic.pojo.vo.UserSimpleVO;
import cn.iocoder.yudao.module.api.brokerage.record.enums.BrokerageBonusLevelEnum;
import cn.iocoder.yudao.module.api.brokerage.record.enums.BrokerageRecordBizTypeEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "推广用户分佣记录 Response VO")
@Data
public class AdminBrokerageRecordVO extends MemberScopeVO {

    @Schema(description = "分佣级别：1-一级、2-二级")
    private Integer bonusLevel;

    @Schema(description = "分佣级别：1-一级、2-二级")
    private String bonusLevelName;

    @SuppressWarnings("unused")
    public String getBonusLevelName() {
        return BrokerageBonusLevelEnum.valueOf(getBonusLevel()).getName();
    }

    @Schema(description = "分佣比例，0-100之间的数字")
    private Double bonusPercent;

    @Schema(description = "分佣金额，单位为分")
    private Integer bonusMoney;

    @Schema(description = "业务类型")
    private String bizType;

    @Schema(description = "业务类型")
    private String bizTypeName;

    @SuppressWarnings("unused")
    public String getBizTypeName() {
        return BrokerageRecordBizTypeEnum.codeOf(getBizType()).getName();
    }

    @Schema(description = "业务编号")
    private String bizId;

    @Schema(description = "来源用户编号")
    private Long sourceUserId;

    @Schema(description = "来源用户信息", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private UserSimpleVO sourceUser;

    @Schema(description = "分佣基准金额，单位为分")
    private Integer basePrice;

    @Schema(description = "状态：0-待入账、1-已结算、2-已失效、3-已取消")
    private Integer status;

    @Schema(description = "解冻时间")
    private LocalDateTime unfreezeTime;

    @Schema(description = "取消时间")
    private LocalDateTime cancelTime;

    @Schema(description = "备注")
    private String note;

}